home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
shazam11.zip
/
DEMOSE.VIR
< prev
next >
Wrap
Text File
|
1991-11-04
|
8KB
|
210 lines
{===================================================================
VARIABLES & OBJECTS
===================================================================}
const
HeapSize = 32 * ( 1024 div 16 ) ; { reserve 32 k }
var
ClipWindow : PEditWindow ; { Clipboard }
Clock : PClockView ; { Gadget }
{===================================================================
Make use of idle time
===================================================================}
procedure TDemoSEApp.Idle ;
begin
TApplication.Idle ;
Clock^.Update ;
end ;
{===================================================================
MESSAGE
===================================================================}
procedure SyntaxMessage ;
begin
writeln ( 'SYNTAX: C:>ed {loads DOS & Windows files}' ) ;
writeln ( ' C:>ed filename {load ''filename''}' ) ;
writeln ( ' C:>ed filespec {multi-load ''filespec''; eg: *.bat}' ) ;
writeln ;
writeln ( ' Start-up file Used by Description' ) ;
writeln ( ' --------------- ------- -----------------------------------' ) ;
writeln ( ' <> AUTOEXEC.BAT DOS AUTOmatic EXECution BATch file' ) ;
writeln ( ' <> CONFIG.SYS DOS CONFIGure SYStem file' ) ;
writeln ( ' <> WIN.INI Windows WINdows INItialization file' ) ;
writeln ( ' <> SYSTEM.INI Windows SYSTEM hardware INItialization file' ) ;
end ;
{===================================================================
PRE
BUFFERS.TPU re-arranges heap pointers. Whatta pain, but some smart
guy might turn this into virtual memory someday, like WordPerfect.
===================================================================}
procedure TDemoSEApp.PreInit ;
var
H : word ;
begin
writeln ( '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' ) ;
writeln ( '░▒▓█ Ye Olde Systeme Editor █▓▒░ Copyright (c) 1991 Johnathan J. Stein' ) ;
writeln ( '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -' ) ;
if ( ParamStr ( 1 ) = '?' ) or
( ParamStr ( 1 ) = '/?' ) then
begin
SyntaxMessage ;
HALT ;
end ;
PushScreen ;
H := PtrRec ( HeapEnd ).Seg -
PtrRec ( HeapPtr ).Seg ;
if H > HeapSize then
BufHeapSize := H - HeapSize
else
BufHeapSize := 0 ;
InitBuffers ;
end ;
{===================================================================
POST
===================================================================}
procedure TDemoSEApp.PostInit ;
var
R : TRect ;
SR : SearchRec ;
FileCount : byte ;
Event : TEvent ;
begin
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Clock
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
GetExtent ( R ) ;
R.A.X := R.B.X - 9 ;
R.B.Y := R.A.Y + 1 ;
Clock := New ( PClockView ,
Init ( R ) ) ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Desktop
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
Insert ( Clock ) ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Disable EGA/VGA
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
if not HiResScreen or ( Screenmode = smMono ) then
Desktop^.DisableCommands ( [ cmVideoMode ] ) ;
DisableCommands ( [ cmSave,
cmSaveAs,
cmCut,
cmCopy,
cmPaste,
cmClear,
cmUndo,
cmFind,
cmReplace,
cmSearchAgain ] ) ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DIALOGS & CLIP BOARD
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
EditorDialog := DoEditDialog ;
ClipWindow := OpenEditor ( '' , FALSE ) ;
if ClipWindow <> NIL then
begin
Clipboard := ClipWindow^.Editor ;
Clipboard^.CanUndo := FALSE ;
end ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LOAD SYSTEM FILES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
FileCount := 0 ;
if ParamCount = 0 then
begin
FileCount := 4 ;
LoadWinIni ;
LoadDosIni ;
heTile ;
end
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LOAD FILENAME
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
else
if ( Pos ( '*' , ParamStr ( 1 ) ) = 0 ) and
( Pos ( '?' , ParamStr ( 1 ) ) = 0 ) then
begin
OpenEditor ( ParamStr ( 1 ) , TRUE ) ; { no wildcards }
inc ( FileCount ) ;
end
else
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MULTI-LOAD
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
begin
FindFirst ( ParamStr ( 1 ) , AnyFile , SR ) ;
while DosError = 0 do
begin
if ( SR.Attr and Directory = 0 ) and
( SR.Attr and ReadOnly = 0 ) and
( SR.Attr and Hidden = 0 ) and
( SR.Attr and SysFile = 0 ) and
( SR.Attr and VolumeID = 0 ) and
( SR.Name <> '.' ) and
( SR.Name <> '..' ) and
( pos ( '.COM' , SR.Name ) = 0 ) and
( pos ( '.EXE' , SR.Name ) = 0 ) and
( pos ( '.OVR' , SR.Name ) = 0 ) and
( pos ( '.OVL' , SR.Name ) = 0 ) and
( pos ( '.VRM' , SR.Name ) = 0 ) and
( pos ( '.BIN' , SR.Name ) = 0 ) and
( pos ( '.SYS' , SR.Name ) = 0 ) and
( pos ( '.HLP' , SR.Name ) = 0 ) and
( pos ( '.CPI' , SR.Name ) = 0 ) and
( pos ( '.DLL' , SR.Name ) = 0 ) and
( pos ( '.LIB' , SR.Name ) = 0 ) and
( pos ( '.BGI' , SR.Name ) = 0 ) and
( pos ( '.CHR' , SR.Name ) = 0 ) and
( pos ( '.ARC' , SR.Name ) = 0 ) and
( pos ( '.ZIP' , SR.Name ) = 0 ) then
begin
OpenEditor ( SR.Name , TRUE ) ;
inc ( FileCount ) ;
end ;
FindNext ( SR ) ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LIMIT
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
if FileCount >= 16 then
begin
MessageBox ( 'Cannot auto-load more than 16 files' ,
NIL ,
mfInformation + mfOKbutton ) ;
DosError := 18 ;
end ;
end ;
heCascade ;
end ;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DISPLAY ABOUT IF NO FILES
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
if FileCount <> 0 then EXIT ;
Event.What := evCommand ;
Event.Command := cmAbout ;
PutEvent ( Event ) ;
end ;
{===================================================================
PRE
===================================================================}
procedure TDemoSEApp.PreDone ;
begin
Delete ( Clock ) ;
Dispose ( Clock , Done ) ;
end ;
{===================================================================
POST
===================================================================}
procedure TDemoSEApp.PostDone ;
begin
DoneBuffers ;
PopScreen ;
SyntaxMessage ;
end ;